/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Microsoft
 * Date: 2023-01-16
 * Time: 12:10
 */
class MyArray{
    public Object[] obj = new Object[3];

    public Object getObj(int pos) {
        return obj[pos];
    }
    public void setObj(int pos , Object val){
        obj[pos] = val;
    }
}
public class Test {
    public static void main(String[] args) {
        MyArray myArray = new MyArray();
        myArray.setObj(0,10);
        myArray.setObj(1,"hello");//字符串也可以存放
        String ret = myArray.getObj(1);//编译报错
    }
}
